<!DOCTYPE html>
<!--[if IE 8]>    <html class="no-js ie8 ie" lang="en"> <![endif]-->
<!--[if IE 9]>    <html class="no-js ie9 ie" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <?php include_title() ?>
    <?php include_metas() ?>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Style -->
    <?php include_stylesheets() ?>

    <!-- Favicon -->
    <link rel="shortcut icon" href="/favicon.ico">

    <!-- JS Libs -->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="/js/libs/jquery.js"><\/script>')</script>
    <script src="/js/libs/modernizr.js"></script>
    <script src="/js/libs/selectivizr.js"></script>

    <script>
        $(document).ready(function(){

            // Tooltips
            $('.user-profile a, .dashboard .badge').tooltip({
                placement: 'top'
            });
            $('.brand, .navbar-search input').tooltip({
                placement: 'bottom'
            });
            $('.main-navigation .badge').tooltip({
                placement: 'right'
            });
            $('a.btn').tooltip({
                placement: 'left'
            });

        });
    </script>
</head>
<body>

<!-- Main page header -->
<header class="navbar">

    <!-- Navbar style -->
    <div class="navbar-inner">

        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <a class="btn btn-alt btn-primary btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>

        <!-- Sample logo -->
        <a href="index.html" class="brand" title="Back to homepage">Organon Responsive Twitter Bootstrap Admin Template</a>

        <!-- Everything you want hidden at 940px or less, place within here -->
        <div class="nav-collapse">

            <!-- Header navigation -->
            <nav>
                <ul role="navigation">
                    <li<?php echo ($sf_context->getInstance()->getRouting()->getCurrentRouteName() == 'homepage') ? ' class="active"':''?>><a href="<?php echo url_for('@homepage')?>"><span class="awe-home"></span>Dashboard</a></li>
                    <li<?php echo ($sf_params->get('module') == 'book') ? ' class="active"':''?>><a href="<?php echo url_for('@book')?>"><span class="awe-book"></span>Books</a></li>
                </ul>
            </nav>
            <!-- /Header navigation -->

            <!-- Logout -->
            <a class="navbar-logout" href="<?php echo url_for('@sf_guard_signout')?>"><span class="awe-off"></span>Log out</a>

            <!-- Header search box --
            <form class="form-search pull-right">
                <input type="text" class="search-query" name="search" title="Enter the search term" placeholder="Search&#8230;" autocomplete="on">
                <button type="submit" class="btn btn-alt btn-primary">Search</button>
            </form>
            <!-- /Header search box -->

        </div>

    </div>
    <!-- /Navbar style -->

</header>
<!-- /Main page header -->

<!-- Full page alert --
<div class="alert alert-info fade in">
    <button type="button" class="close" data-dismiss="alert"><span class="awe-remove-circle"></span></button>
    <strong>Warning!</strong> Best check yo self, you're not looking too good.
</div>
<!-- /Full page alert -->

<!-- Main page container -->
<div class="container-fluid">

<!-- Left (navigation) side -->
    <?php include_component('dashboard','sidebar')?>
<!-- /Left (navigation) side -->

<!-- Right (content) side -->
<div class="content-block" role="main">

    <?php include_partial('dashboard/breadcrumb') ?>
    <?php echo $sf_content ?>

</div>
<!-- /Right (content) side -->

</div>
<!-- Main page container -->

<!-- Scripts -->
<?php include_javascripts() ?>

<!-- Block TODO list -->
<script>
    $(document).ready(function() {

        $('.todo-block input[type="checkbox"]').click(function(){
            $(this).closest('tr').toggleClass('done');
        });
        $('.todo-block input[type="checkbox"]:checked').closest('tr').addClass('done');

    });
</script>

<!-- jQuery FullCalendar -->
<script>
    $(document).ready(function() {

        var date = new Date();
        var d = date.getDate();
        var m = date.getMonth();
        var y = date.getFullYear();

        $('.fullcalendar').fullCalendar({
            header: {
                left: 'title',
                center: '',
                right: 'today month,basicWeek prev,next'
            },
            buttonText: {
                prev: '<span class="awe-arrow-left"></span>',
                next: '<span class="awe-arrow-right"></span>'
            },
            editable: true,
            events: [
                {
                    title: 'Event',
                    start: new Date(y, m, 1),
                    className : 'organon-event organon-event-yellow'
                },
                {
                    title: 'Event',
                    start: new Date(y, m, d-5),
                    end: new Date(y, m, d-2),
                    className : 'organon-event organon-event-green'
                },
                {
                    id: 999,
                    title: 'Event',
                    start: new Date(y, m, d-3, 16, 0),
                    allDay: false,
                    className : 'organon-event organon-event-blue'
                },
                {
                    id: 999,
                    title: 'Event',
                    start: new Date(y, m, d+4, 16, 0),
                    allDay: false,
                    className : 'organon-event organon-event-black'
                },
                {
                    title: 'Meeting',
                    start: new Date(y, m, d, 10, 30),
                    allDay: false,
                    className : 'organon-event organon-event-red'
                },
                {
                    title: 'Lunch',
                    start: new Date(y, m, d, 12, 0),
                    end: new Date(y, m, d, 14, 0),
                    allDay: false,
                    className : 'organon-event organon-event-purple'
                },
                {
                    title: 'Party',
                    start: new Date(y, m, d+1, 19, 0),
                    end: new Date(y, m, d+1, 22, 30),
                    allDay: false,
                    className : 'organon-event'
                }
            ]
        });

    });
</script>

<!-- jQuery Visualize -->
<!--[if lte IE 8]>
<script language="javascript" type="text/javascript" src="js/plugins/visualize/excanvas.js"></script>
<![endif]-->
<script>
    $(document).ready(function() {

        $('table.demo').each(function() {
            var chartType = ''; // Set chart type
            var chartWidth = $(this).parent().width()*0.95; // Set chart width to 90% of its parent

            if(chartWidth < 350) {
                var chartHeight = chartWidth;
            }else{
                var chartHeight = chartWidth*0.25;
            }

            $(this).hide().visualize({
                type: $(this).attr('data-chart'),
                width: chartWidth,
                height: chartHeight,
                colors: ['#3a87ad','#b94a48', '#468847']
            });
        });

    });
</script>

<!-- jQuery SparkLines -->
<script>
    $(document).ready(function() {

        // Sample line chart
        $('.sparkline.line').sparkline('html', {
            height: '35px',
            width: '70px',
            lineColor: '#e5e5e5',
            fillColor: '#868585',
            spotColor: '#3a87ad',
            minSpotColor: false,
            maxSpotColor: false,
            spotRadius: 3
        });

        // Sample bar chart
        $('.sparkline.bar').sparkline([17, 23, 18, 14, 18, 19, 13], {
            type: 'bar',
            height: '35px',
            barWidth: '6px',
            barColor: '#3a87ad',
            tooltipFormat: '{{offset:names}}: {{value}} orders',
            tooltipValueLookups: {
                names: {
                    0: 'Monday',
                    1: 'Tuesday',
                    2: 'Wednesday',
                    3: 'Thursday',
                    4: 'Friday',
                    5: 'Saturday',
                    6: 'Sunday'
                }
            }
        });

    });
</script>
<?php include_slot('footer_js')?>
</body>
</html>